package com.clusterswisdom.horn.api.tmall.action;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.tmall.TmallInstance;
import com.taobao.api.TaobaoResponse;

public class DefaultTmallAction extends AbstractTmallAction implements HornAction {

	@Override
	public HornResponse execute(ApiConfig config, JSONObject param) throws Exception {
		TaobaoResponse response = TmallInstance.getInstance().executeRequest(param, config);
		if (response.isSuccess()) {
			return new HornResponse(true, response);
			
		}  else {
			return getUnsuccessResponse(response);
			
		}
	}
}